-
Notifications
You must be signed in to change notification settings - Fork 1.3k
ReactiveElasticsearchClient should use the same request parameters as… #1703
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
6d28592
to
2de7710
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In ReactiveElasticsearchClient
I'd prefer if the deprecated versions use the fully qualified name of the parameter and the new functions use the imported names. Makes the old functions looking more ugly ;-9
Thank you for the PR, great work.
One missing piece: There are the existsIndex
functions that use the old GetIndexRequest
values which should be changed as well. The recently added getIndex
calls already use the correct one.
Otherwise just some minor documentation things and one comment about which classes should be imported and which fully qualified
...java/org/springframework/data/elasticsearch/client/reactive/ReactiveElasticsearchClient.java
Show resolved
Hide resolved
...java/org/springframework/data/elasticsearch/client/reactive/ReactiveElasticsearchClient.java
Show resolved
Hide resolved
...java/org/springframework/data/elasticsearch/client/reactive/ReactiveElasticsearchClient.java
Show resolved
Hide resolved
@@ -126,6 +126,10 @@ | |||
return RequestConverters::indexCreate; | |||
} | |||
|
|||
default Function<org.elasticsearch.client.indices.CreateIndexRequest, Request> createIndex() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add @since 4.2
; and we should deprecate the indexCreate()
method that uses the old class.
It's a pity that we need a new name here. Although createIndex()
is better than indexCreate
in my opinion.
Or could use createIndexRequest()
like you have it with the putMappingRequest
, but then we probably should rename them all to xxxRequest()
, deprecating the existing ones - might be something for a cleanup-ticket in the future.
But we should nevertheless deprecated the existing indexCreate
method as it's only called by the deprectaed method from the client.
src/main/java/org/springframework/data/elasticsearch/client/reactive/RequestCreator.java
Show resolved
Hide resolved
be7d22d
to
043f2b0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please add versions of existsIndex()
that use the "new" GetIndexRequest
? That's all that's still missing
@@ -653,6 +653,15 @@ private RequestBodySpec sendRequest(WebClient webClient, String logId, Request r | |||
.next(); | |||
} | |||
|
|||
@Override | |||
public Mono<Boolean> createIndex(HttpHeaders headers, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this one should have the imported class like in the interface, and the other one in line 649 the fully qualified name
@@ -688,6 +697,14 @@ private RequestBodySpec sendRequest(WebClient webClient, String logId, Request r | |||
return sendRequest(getMappingsRequest, requestCreator.getMapping(), GetMappingsResponse.class, headers).next(); | |||
} | |||
|
|||
@Override | |||
public Mono<org.elasticsearch.client.indices.GetMappingsResponse> getMapping(HttpHeaders headers, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above with fully qualified names
@@ -708,6 +725,14 @@ private RequestBodySpec sendRequest(WebClient webClient, String logId, Request r | |||
.next(); | |||
} | |||
|
|||
@Override | |||
public Mono<Boolean> putMapping(HttpHeaders headers, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
… non reactive code
043f2b0
to
15688da
Compare
Thanks again for you contribution. The PR has been merged. |
… non reactive code